/*
 * sendinfocommand.h
 *
 *  Created on: Aug 10, 2010
 *      Author: kevin
 */

#ifndef SENDINFOCOMMAND_H_
#define SENDINFOCOMMAND_H_

#include <string>
#include <Poco/Net/Socket.h>
#include "node/node.h"

using namespace std;
using namespace Poco::Net;

#include "nodecommand.h"

namespace Commands {
	class SendInfoCommand: public Commands::NodeCommand
	{
		public:
			SendInfoCommand(SocketAddress addr, NodeData* node = 0);
			virtual ~SendInfoCommand();
			/**
			* Executes the command
			*/
			void execute();

			/**
			* Returns the name by which the command is registered with a CommandFactory
			* @return commandname
			*/
			string name();

			/**
			* Return a string with which this command can be remade if it were fed into a CommandFactory
			* @return representational string
			*/
			string repr();

			/**
			* Return the creator to make this command given the representational string
			* @return a CommandCreator for this Command
			*/
			CommandCreator creator();
		protected:
			virtual Document* toXML(Document* doc = 0);

		private:
			static Command* makeCommand(string r, void* s);
			static const string NAME;
			SocketAddress _addr;
	};

}

#endif /* SENDINFOCOMMAND_H_ */
